package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.entity.banquet.UserBanquetRecord;
import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.banquet.BanquetModule;
import com.yanqu.road.server.pb.BanquetPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_CROSS_PARTY_RECORD, desc = "")

public class SendPartyRecordCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        CrossBanquetProto.SendCrossUserBanquetRecordMsg reqMsg = CrossBanquetProto.SendCrossUserBanquetRecordMsg.parseFrom(packet.getBytes());
        UserBanquetRecord userBanquetRecord = BanquetPb.parseToBanquetRecord(reqMsg);
        player.getModule(BanquetModule.class).addBanquetRecord(userBanquetRecord);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
